<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Internet pizzeria - Orders in preparation</title>
</head>
<body>	
<%@ include file="navigationMenu.jsp" %>
	<form method="post" action="ordersInPreparation">
	
	<h2>Orders awaiting preparation</h2>	
	<table border='1'>
	<tr>
			<td>Order number</td>
			<td>Details</td>
			<td>Select</td>
	</tr>
	<c:forEach var="orderInfo" items="${orderInfosReadyToPrepare}">
	<tr>
		<td>${orderInfo.order.id}</td>
		<td>
			<c:forEach var="orderPizza" items="${orderInfo.pizzas}">
			${orderPizza.quantity} x ${orderPizza.product.name} 
			&nbsp;
			</c:forEach>
			<br/>
			<c:forEach var="orderDrink" items="${orderInfo.drinks}">
			${orderDrink.quantity} x ${orderDrink.product.name} 
			&nbsp;
			</c:forEach>
		</td>
		<td><input type="checkbox" name="orderId" value="${orderInfo.order.id}" /></td>				
	</tr>
	</c:forEach>	
	</table>
	
	<input type="submit" name="ordersInPreparationSubmit" value="In preparation">
	</form>
	
	<form method="post" action="ordersInPreparation">
	<h2>Orders in preparation</h2>	
	<table border='1'>
	<tr>
			<td>Order number</td>
			<td>Details</td>
			<td>Select</td>
	</tr>
	<c:forEach var="orderInfo" items="${orderInfosInPreparation}">
	<tr>
		<td>${orderInfo.order.id}</td>
		<td>
			<c:forEach var="orderPizza" items="${orderInfo.pizzas}">
			${orderPizza.quantity} x ${orderPizza.product.name} 
			&nbsp;
			</c:forEach>
			<br/>
			<c:forEach var="orderDrink" items="${orderInfo.drinks}">
			${orderDrink.quantity} x ${orderDrink.product.name} 
			&nbsp;
			</c:forEach>
		</td>
		<td><input type="checkbox" name="orderId" value="${orderInfo.order.id}" /></td>				
	</tr>
	</c:forEach>	
	</table>
	
	<input type="submit" name="ordersPreparedSubmit" value="Ready">
   
	</form>		
</body>
</html>
